package com.glorysoft.knowlespda.model
import com.glorysoft.knowlespda.base.BaseRepository
import com.glorysoft.knowlespda.base.Constant
import com.glorysoft.knowlespda.entity.CountEntity
import com.google.gson.JsonObject
import rxhttp.wrapper.param.RxHttp
import rxhttp.wrapper.param.toResponse


/**
 * FileName: LoginRepository
 * Author: XJH
 * Date: 2021/5/24 17:11
 * Description:
 * History:
 */
class CountRepository : BaseRepository() {

    suspend fun getCountInfo(map: JsonObject): CountEntity {
        return RxHttp.postForm(Constant.REQUEST_URL_DEBUG)
            .addAll(getInJsonData(map,"GetCountInfo"))
            .toResponse<CountEntity>()
            .await()


    }

    suspend fun updateCount(map: JsonObject): JsonObject {
        return RxHttp.postForm(Constant.REQUEST_URL_DEBUG)
            .addAll(getInJsonData(map,"UpdateCount"))
            .toResponse<JsonObject>()
            .await()


    }
}